<template>
  <div></div>
</template>

<script>
import { isMemberRole } from "@/utils/session";
import { getToken } from "@/utils/auth";

export default {
  name: "Redirest",

  methods: {
    redirect_case() {
      const member_role = isMemberRole();
      if (member_role) {
        //读取token
        const token = getToken();
        console.log(token);
        if (token) {
          this.$router.replace("/case");
        } else {
          //token不存在,进入登录界面
          console.log("to login........");
          this.$router.replace("/lawyer_login");
        }
      } else {
        this.$router.replace("/case");
      }
    },
  },
  created() {
    this.redirect_case();
  },
};
</script>

<style  scoped>
</style>